<?php
define("_needlogin", "0");
define("_access", "1");
include_once("include/db.config.php");
$id=$_SESSION['writeup_id'];
$sql="SELECT * from challenge where id='$id'";
$writeup_id=getOne($sql)['writeup_id'];
$sql="SELECT * from writeup where id=$writeup_id";
$r=getOne($sql);
$_SESSION['rr']=$r;
?>
<!DOCTYPE html>
<html>
<?php include("include/head.php"); ?>
<body>
<?php include("include/nav.php"); ?>
<link rel="stylesheet" type="text/css" href="./source/c3.min.css">
<div>
	<br>
	<br>
	<br>
	<h1 class="row">
		<?php
			if($_SESSION['rr']) 
			echo($_SESSION['rr']['title']);
			else
				echo "该题题解还未发布，请耐心等待";
		 ?>
	</h1>
	<br>
	<h4 class="row">
		<?php 
			if($_SESSION['rr'])
			{
				echo "<span>作者:</span>";
				echo($_SESSION['rr']['author']);
		}
		 ?>
	</h4>
	<br>
	<br>
	<br>
	<div class="row">
		<?php
			if($_SESSION['rr']) 
			echo($_SESSION['rr']['content']);
		 ?>
	</div>
</div>
<?php unset($_SESSION['rr']); ?>
<?php unset($_SESSION['writeup_id']); ?>
<?php include("include/script.php"); ?>
</body>
</html>